/*
 * Copyright (c) 2013-2015 Charkey. All rights reserved.
 *
 * This software is the confidential and proprietary information of Charkey.
 * You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the agreements you entered into with Charkey.
 *
 * Charkey MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
 *
 * Charkey SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
 * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
 */

package cn.simastudio.talos.inter.model.inst;

import com.alibaba.fastjson.annotation.JSONField;

import java.io.Serializable;
import java.util.List;

/**
 * Usage: DemoUser
 *
 * @author Charkey
 * @date 2015/4/28 14:51
 */
public class DemoUser implements Serializable {

    private static final long serialVersionUID = 2762848056792545354L;

    /**
     * ID
     */
    private Integer id;

    /**
     * 名字
     */
    @JSONField(name = "user_name")
    private String userName;

    /**
     * 单独配置的userCountryId字段，可以通过配置不同的resultMap，
     * 在不同的情景下，只查询User一张表，后面根据业务需要再根据User表中的user_country去查询Country信息
     */
    @JSONField(name = "user_country_id")
    private Integer userCountryId;

    /**
     * user表中有一个user_country字段，所以在User类中定义一个Country属性，
     * 用于维护User和Country之间的一对一关系，通过这个Country属性就可以知道这个用户是哪个国籍
     */
    @JSONField(name = "user_country")
    private DemoCountry userCountry;

    /**
     * 表示当前用户拥有的Profile信息
     */
    @JSONField(name = "user_profiles")
    private List<DemoProfile> userProfiles;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    public Integer getUserCountryId() {
        return userCountryId;
    }

    public void setUserCountryId(Integer userCountryId) {
        this.userCountryId = userCountryId;
    }

    public DemoCountry getUserCountry() {
        return userCountry;
    }

    public void setUserCountry(DemoCountry userCountry) {
        this.userCountry = userCountry;
    }

    public List<DemoProfile> getUserProfiles() {
        return userProfiles;
    }

    public void setUserProfiles(List<DemoProfile> userProfiles) {
        this.userProfiles = userProfiles;
    }

    @Override
    public String toString() {
        return "DemoUser{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", userCountryId=" + userCountryId +
                ", userCountry=" + userCountry +
                ", userProfiles=" + userProfiles +
                '}';
    }
}